package com.aspose.cells;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;

class zsx {
   private Workbook i;
   private WorksheetCollection j;
   private Worksheet k;
   private Cells l;
   private int m;
   private double n;
   private HashMap o;
   private double[] p;
   int a = -1;
   int b = -1;
   int c = -1;
   int d = -1;
   private double q;
   private double r;
   private double s;
   private double t;
   private double u;
   private double v;
   private Style w;
   private ArrayList x;
   private ArrayList y;
   private int z = -1;
   private int A = 0;
   private int B = -1;
   private int C = 0;
   private ArrayList D;
   private int E;
   private com.aspose.cells.b.a.b.zt F;
   com.aspose.cells.a.d.ze e;
   private double G = -1.1D;
   private double H = -1.1D;
   private double I = 0.0D;
   private double J = 0.0D;
   public ArrayList f;
   ArrayList g;
   private HashMap K = new HashMap();
   ImageOrPrintOptions h;
   private zbuz L;
   private double[] M;
   private ArrayList N;

   zsx(Workbook var1, zbuz var2) {
      this.i = var1;
      this.L = var2;
      this.j = var1.getWorksheets();
      this.p = new double[]{1.0D, 1.0D};
      this.n = (double)var1.getWorksheets().L();
      this.o = new HashMap();
      this.w = var1.getWorksheets().D();

      for(int var3 = 0; var3 < this.j.getCount(); ++var3) {
         this.j.get(var3).getConditionalFormattings().a();
      }

      this.F = new com.aspose.cells.b.a.b.zt(0.0F, 0.0F);
      this.E = -(var1.getWorksheets().J() + var1.getWorksheets().I() + 2);
      this.f = new ArrayList();
      this.g = new ArrayList();
   }

   private void a() {
      ShapeCollection var1 = this.k.t();
      ArrayList var2 = new ArrayList();
      new ArrayList();
      if (var1 != null) {
         for(int var4 = 0; var4 < var1.getCount(); ++var4) {
            Shape var5 = var1.get(var4);
            if (!var5.S()) {
               zbgq var6 = new zbgq(var5, var4, (String)null);
               if (var6.i() == 8) {
                  ;
               }

               if (var6.i() == 0) {
                  this.a(var6, (GroupShape)var5, 0.0D, 0.0D, var6.g(), var6.h());
                  com.aspose.cells.b.a.a.ze.a(var2, (Object)var6);
               }

               if (!var5.S()) {
                  com.aspose.cells.b.a.a.ze.a(var2, (Object)var6);
               }
            }
         }
      }

      this.K.put(this.k, var2);
   }

   private void a(zbgq var1, GroupShape var2, double var3, double var5, double var7, double var9) {
      for(int var11 = 0; var11 < var2.d().size(); ++var11) {
         Shape var12 = (Shape)var2.d().get(var11);
         zbgq var13 = new zbgq(var12, var11, (String)null);
         if (var13 != null) {
            int[] var14 = var12.d(false);
            var13.b(var3 + (double)var14[0] * var7 / 4000.0D);
            var13.a(var5 + (double)var14[1] * var9 / 4000.0D);
            var13.c((double)var14[2] * var7 / 4000.0D);
            var13.d((double)var14[3] * var9 / 4000.0D);
            com.aspose.cells.b.a.a.ze.a(var1.a, (Object)var13);
            if (var12.getMsoDrawingType() == 0) {
               this.a(var13, (GroupShape)var12, var13.b(), var13.a(), var13.g(), var13.h());
            }
         }
      }

   }

   private void b() throws Exception {
      this.c = zatm.b(this.k, this.x);
      if (this.i.k()) {
         this.b = this.a(true, 0, 0, 1048575, 16383);
      } else {
         this.b = this.a(true, 0, 0, 65535, 255);
      }

      this.c();
      if (this.b >= 0) {
         if (this.d >= 0) {
            if (this.k.getPageSetup().a(false)) {
               this.a = zatm.a(this.k, this.x);
            } else {
               this.a = 0;
            }

            if (this.d != -1) {
               ;
            }
         }
      }
   }

   private void a(Worksheet var1) {
      this.k = var1;
      this.N = null;
      this.l = this.k.getCells();
      this.z = -1;
      this.A = -1;
      PageSetup var2 = this.k.getCharts().get(0).getPageSetup();
      this.a(var2);
   }

   private void b(Worksheet var1) throws Exception {
      this.k = var1;
      this.N = null;
      this.l = var1.getCells();
      this.z = -1;
      this.A = -1;
      PageSetup var2 = var1.getPageSetup();
      this.a(var2);
      this.a();
      zani var3 = var1.getCells().q();
      this.x = new ArrayList(var3.getCount());

      for(int var4 = 0; var4 < var3.getCount(); ++var4) {
         com.aspose.cells.b.a.a.ze.a(this.x, (Object)(new zfu(var3.a(var4))));
      }

      Collections.sort(this.x);
      this.y = new ArrayList();
      this.a = -1;
      this.b = -1;
      this.c = -1;
      this.d = -1;
      this.b();
      if (this.h != null && !this.h.a()) {
         CellArea var8 = new CellArea();
         var8.StartRow = this.l.getMinRow();
         var8.StartColumn = this.l.getMinColumn();
         var8.EndRow = this.l.d(0);
         var8.EndColumn = this.l.b((short)0);
         this.N = new ArrayList();
         com.aspose.cells.b.a.a.ze.a(this.N, (Object)var8);
         double var5 = 0.0D;

         int var7;
         for(var7 = var8.StartColumn; var7 <= var8.EndColumn; ++var7) {
            var5 += this.l.c.b(var7);
         }

         this.s = var5 * 72.0D;
         var5 += this.G + this.I;
         this.q = var5;
         var5 = 0.0D;

         for(var7 = var8.StartRow; var7 <= var8.EndRow; ++var7) {
            var5 += this.l.getRowHeightInch(var7);
         }

         this.t = var5 * 72.0D;
         var5 += (this.H + this.J) / 2.54D;
         this.r = var5;
      } else {
         this.N = zatm.b(var1);
      }

   }

   private static boolean a(Cell var0, Style var1) {
      if (var0 == null) {
         return false;
      } else if (var0.c.g() != 3) {
         return true;
      } else {
         Style var2 = var0.p();
         return var2 != null && zatm.a(var2, var1);
      }
   }

   private boolean a(zfu var1, Style var2) {
      for(int var3 = var1.a; var3 <= var1.c; ++var3) {
         if (this.l.getRowHeight(var3) != 0.0D) {
            for(int var4 = var1.b; var4 <= var1.d; ++var4) {
               if (a(this.l.getRows().a.a(var3, var4), var2)) {
                  return true;
               }
            }
         }
      }

      return false;
   }

   private int a(boolean var1, int var2, int var3, int var4, int var5) {
      int var6 = -1;
      zahr var7 = this.l.getRows().a.a(var2, var4, true);
      zfv var10 = new zfv();

      while(var7.hasNext()) {
         zp var9 = var7.e();
         if (!Row.a(var9) && var9.j() != 0) {
            zahl var8 = var9.b(var3, var5, false);
            if (var8 != null) {
               while(true) {
                  int var12 = var8.a();
                  if (var12 < 0) {
                     break;
                  }

                  zfv var11 = var9.a(var12, var10, 7);
                  if (this.l.c.a(var11.a) != 0) {
                     if (var11.g() != 3) {
                        var6 = var9.h();
                        break;
                     }

                     Style var13 = Cell.a(this.l, var9, var11);
                     if (var13 != null && zatm.a(var13, this.w)) {
                        var6 = var9.h();
                        break;
                     }
                  }
               }
            }

            if (var6 != -1) {
               break;
            }
         }
      }

      if (!var1 && var6 == var4) {
         return var6;
      } else {
         int var18;
         if (this.x != null && this.x.size() > 0) {
            zfu var14;
            if (var1) {
               for(var18 = this.x.size() - 1; var18 >= 0; --var18) {
                  var14 = (zfu)this.x.get(var18);
                  if (this.a(var14, this.w) && var6 < var14.c) {
                     var6 = var14.c;
                     break;
                  }
               }
            } else {
               for(var18 = this.x.size() - 1; var18 >= 0; --var18) {
                  var14 = (zfu)this.x.get(var18);
                  if (var14.a <= var4 && var14.c >= var2 && var14.b <= var5 && var14.d >= var3 && var14.c > var6) {
                     var6 = var14.c;
                  }
               }
            }
         }

         this.D = (ArrayList)this.K.get(this.k);
         if (this.D != null && this.D.size() > 0) {
            boolean var19 = false;

            for(int var20 = 0; var20 < this.D.size(); ++var20) {
               zbgq var15 = (zbgq)this.D.get(var20);
               if (!var15.j().isHidden() && var15.j().isPrintable() && !var15.j().S()) {
                  var18 = var15.k().EndRow;
                  if (var18 > var6) {
                     if (var1) {
                        var6 = var18;
                     } else if (var15.c() <= var4 && var15.d() >= var2 && var15.e() <= var5 && var15.f() >= var3) {
                        if (var18 >= var4) {
                           return var4;
                        }

                        var6 = var18;
                     }
                  }
               }
            }
         }

         if (this.k.getSparklineGroupCollection() != null && this.k.getSparklineGroupCollection().getCount() > 0) {
            for(var18 = 0; var18 < this.k.getSparklineGroupCollection().getCount(); ++var18) {
               SparklineGroup var21 = this.k.getSparklineGroupCollection().get(var18);
               SparklineCollection var22 = var21.getSparklineCollection();
               if (var22.b().getIndex() == this.k.getIndex()) {
                  for(int var16 = 0; var16 < var22.getCount(); ++var16) {
                     Sparkline var17 = var22.get(var16);
                     if (var17.getRow() > var6) {
                        var6 = var17.getRow();
                     }
                  }
               }
            }
         }

         return var6;
      }
   }

   private boolean a(int var1, int var2, int var3, int var4) throws Exception {
      Cells var5 = this.k.getCells();
      int var6;
      if (this.x.size() > 0) {
         for(var6 = this.x.size() - 1; var6 >= 0; --var6) {
            zfu var7 = (zfu)this.x.get(var6);
            if (var7.a <= var3 && var7.c >= var1 && var7.b <= var4 && var7.d >= var2) {
               return true;
            }
         }
      }

      if (this.D != null && this.D.size() > 0) {
         for(var6 = 0; var6 < this.D.size(); ++var6) {
            zbgq var19 = (zbgq)this.D.get(var6);
            if (var19.c() <= var3 && var19.d() >= var1 && var19.e() <= var4 && var19.f() >= var2) {
               return true;
            }
         }
      }

      Cell var18 = null;
      Cell var20 = null;
      zahr var8 = var5.getRows().a.a(var1, var3, true);

      while(true) {
         Row var11;
         do {
            if (!var8.hasNext()) {
               return false;
            }

            var11 = var8.f();
         } while(var11.a() <= 0);

         zahl var9 = var11.a.a(-1, -1, true);

         while(true) {
            int var10 = var9.a();
            if (var10 < 0) {
               break;
            }

            Style var12 = null;
            Cell var13 = new Cell(var11, var10);
            if (var13.getColumn() > var4) {
               if (var13.c.g() != 3) {
                  var18 = var13;
               }
            } else if (var13.getColumn() < var2) {
               if (var13.c.g() != 3) {
                  var20 = var13;
               }
            } else {
               if (var13.c.g() != 3) {
                  return true;
               }

               Style var14 = var13.p();
               if (var14 != null && zatm.a(var14, this.w)) {
                  return true;
               }
            }

            int var16;
            int var17;
            double var21;
            if (var20 != null && var20.c.g() == 5 && var20.p().getHorizontalAlignment() != 8) {
               var12 = var20.p();
               if (!var12.isTextWrapped()) {
                  var21 = (double)zatm.a(var20.a(0, false), var12.getFont(), 1.0D, var12.getRotationAngle());
                  var16 = 0;

                  for(var17 = var20.getColumn(); var17 < var2; ++var17) {
                     var16 += var5.c.a(var17);
                  }

                  if ((double)var16 < var21 + 2.0D) {
                     return true;
                  }
               }
            }

            if (var18 != null && var18.c.g() == 5) {
               var12 = var18.p();
               if (var12.getHorizontalAlignment() == 8 && var13.c.g() == 5 && !var12.isTextWrapped()) {
                  var21 = (double)zatm.a(var18.a(0, false), var12.getFont(), 1.0D, var12.getRotationAngle());
                  var16 = 0;

                  for(var17 = var18.getColumn(); var17 > var4; --var17) {
                     var16 += var5.c.a(var17);
                  }

                  if ((double)var16 < var21 + 2.0D) {
                     return true;
                  }
               }
            }

            var18 = null;
            var20 = null;
         }
      }
   }

   private void c() throws Exception {
      this.d = -1;
      zahr var1 = this.l.getRows().a.a(-1, -1, false);
      zfv var5 = new zfv();

      while(true) {
         while(true) {
            zp var2;
            int var8;
            int var9;
            do {
               do {
                  do {
                     if (!var1.hasNext()) {
                        for(int var14 = 0; var14 < this.x.size(); ++var14) {
                           zfu var16 = (zfu)this.x.get(var14);
                           if (this.d < var16.d && var16.d != 16383 && this.a(var16, this.w)) {
                              this.d = var16.d;
                           }
                        }

                        ArrayList var15 = (ArrayList)this.K.get(this.k);
                        if (var15 != null && var15.size() > 0) {
                           boolean var17 = false;

                           for(var9 = 0; var9 < var15.size(); ++var9) {
                              zbgq var18 = (zbgq)var15.get(var9);
                              Shape var21 = var18.j();
                              if (!var21.isHidden() && var21.isPrintable() && !var21.S()) {
                                 var8 = var18.k().EndColumn;
                                 if (var8 > this.d) {
                                    this.d = var8;
                                 }
                              }
                           }
                        }

                        if (this.k.getSparklineGroupCollection() != null && this.k.getSparklineGroupCollection().getCount() > 0) {
                           for(var8 = 0; var8 < this.k.getSparklineGroupCollection().getCount(); ++var8) {
                              SparklineGroup var19 = this.k.getSparklineGroupCollection().get(var8);
                              SparklineCollection var20 = var19.getSparklineCollection();
                              if (var20.b().getIndex() == this.k.getIndex()) {
                                 for(int var22 = 0; var22 < var20.getCount(); ++var22) {
                                    Sparkline var23 = var20.get(var22);
                                    if (var23.getColumn() > this.d) {
                                       this.d = var23.getColumn();
                                    }
                                 }
                              }
                           }
                        }

                        return;
                     }

                     var2 = var1.e();
                  } while(Row.a(var2));
               } while(var2.j() == 0);
            } while(var2.a() <= 0);

            zahl var3 = var2.a(-1, -1, true);

            while(true) {
               int var4 = var3.a();
               if (var4 < 0) {
                  break;
               }

               zfv var6 = var2.a(var4, var5, 7);
               if (this.l.c.a(var6.a) != 0) {
                  Style var7 = Cell.a(this.l, var2, var6);
                  var8 = var6.g();
                  if (var8 != 3) {
                     var9 = var6.a;
                     if (var8 == 5 && !var7.isTextWrapped() && !var7.getShrinkToFit() && (var7.getHorizontalAlignment() == 7 || var7.getHorizontalAlignment() == 5)) {
                        String var10 = Cell.a(this.l, (zp)var2, var6, 0, false);
                        Font var11 = this.w.getFont();
                        if (var7 != null && var7.q() != null) {
                           var11 = var7.q();
                        }

                        double var12 = zatm.b(var10, var11, 1.0D, var7.getRotationAngle());
                        var9 = zatm.a(this.l.c, var6.a, var12, this.M[0], false);
                     }

                     if (this.d < var9) {
                        this.d = var9;
                     }
                     break;
                  }

                  if (var7 != null && zatm.a(var7, this.w)) {
                     if (this.d < var6.a) {
                        this.d = var6.a;
                     }
                     break;
                  }
               }
            }
         }
      }
   }

   public void a(Worksheet var1, ImageOrPrintOptions var2) throws Exception {
      this.h = var2;
      this.w = this.i.getDefaultStyle();
      this.a(var1.m());
   }

   private com.aspose.cells.b.a.b.zp a(CellArea var1, boolean var2) throws Exception {
      int var3;
      int var4;
      int var5;
      int var6;
      if (var2) {
         var3 = var1.StartRow == -1 ? this.a : var1.StartRow;
         var5 = var1.StartColumn == -1 ? this.c : var1.StartColumn;
         var4 = var1.EndRow == -1 ? this.b : var1.EndRow;
         var6 = var1.EndColumn == -1 ? this.d : var1.EndColumn;
      } else {
         var3 = this.a;
         var4 = this.b;
         var5 = this.c;
         var6 = this.d;
      }

      int[] var7 = zatm.c(this.k);
      this.z = var7[0];
      this.A = var7[1];
      this.B = var7[2];
      this.C = var7[3];
      com.aspose.cells.b.a.b.zp var8 = new com.aspose.cells.b.a.b.zp(var5, var3, var6 - var5 + 1, var4 - var3 + 1);
      if (this.k.getPageSetup().getPrintHeadings()) {
         com.aspose.cells.b.a.b.zt var9 = zatm.a(var4, this.i.getDefaultStyle().getFont(), new double[]{1.0D, 1.0D});
         this.s -= (double)var9.b();
         this.t -= (double)var9.c();
      }

      if (!this.h.getOnlyArea()) {
         this.p = zatm.a(this.k, this.s, this.t, var5, var6, var3, var4, this.z, this.A, this.B, this.C);
      }

      return var8;
   }

   private boolean a(zfu var1) {
      if (this.h != null && this.h.getPrintingPage() != 0) {
         int var2;
         int var3;
         Cell var4;
         if (this.h.getPrintingPage() == 1) {
            for(var2 = var1.a; var2 <= var1.c; ++var2) {
               if (this.l.getRowHeightPixel(var2) > 0) {
                  for(var3 = var1.b; var3 <= var1.d; ++var3) {
                     if (this.l.c.a(var3) > 0) {
                        var4 = this.l.getRows().a.a(var2, var3);
                        if (var4 != null) {
                           if (var4.j() != null && var4.j().length() > 0) {
                              return true;
                           }

                           Style var5 = var4.getStyle();
                           if (var5 != null) {
                              return true;
                           }
                        }
                     }
                  }
               }
            }
         } else if (this.h.getPrintingPage() == 2) {
            for(var2 = var1.a; var2 <= var1.c; ++var2) {
               if (this.l.getRowHeightPixel(var2) > 0) {
                  for(var3 = var1.b; var3 <= var1.d; ++var3) {
                     var4 = this.l.getRows().a.a(var2, var3);
                     if (var4 != null && var4.j() != null && var4.j().length() > 0) {
                        return true;
                     }
                  }
               }
            }
         }

         ShapeCollection var7 = this.k.t();
         if (var7 != null && var7.getCount() > 0) {
            Iterator var8 = var7.iterator();

            while(var8.hasNext()) {
               Shape var9 = (Shape)var8.next();
               if (!var9.isHidden() && var9.isPrintable() && !var9.S()) {
                  com.aspose.cells.b.a.b.zp var10 = new com.aspose.cells.b.a.b.zp(var9.getUpperLeftColumn(), var9.getUpperLeftRow(), var9.getLowerRightColumn() - var9.getUpperLeftColumn(), var9.getLowerRightRow() - var9.getUpperLeftRow());
                  com.aspose.cells.b.a.b.zp var6 = new com.aspose.cells.b.a.b.zp(var1.b, var1.a, var1.d - var1.b, var1.c - var1.a);
                  if (var10.a(var6)) {
                     return true;
                  }
               }
            }
         }

         return false;
      } else {
         return true;
      }
   }

   private void a(CellArea var1, boolean var2, int var3) throws Exception {
      com.aspose.cells.b.a.b.zp var4 = this.a(var1, var2);
      PageSetup var5 = this.k.getPageSetup();
      ArrayList var6 = new ArrayList();
      ArrayList var7 = new ArrayList();
      ArrayList var8 = new ArrayList();
      ArrayList var9 = new ArrayList();
      this.a(this.t, var6, var4);
      this.b(this.s, var8, var4);
      this.a(var6, var7);
      this.b(var8, var9);
      this.f();
      this.h();
      new com.aspose.cells.b.a.b.zq();
      com.aspose.cells.b.a.b.zq var10;
      if (this.h != null && !this.h.a()) {
         var10 = new com.aspose.cells.b.a.b.zq(0.0F, 0.0F, (Float)var9.get(var9.size() - 1), (Float)var7.get(var7.size() - 1));
         if (this.a(new zfu(var1))) {
            this.a(new zfu(var1), var10, var3);
         }
      } else {
         zfu var11 = new zfu();
         if (var6.size() > 0 && var8.size() > 0) {
            int var12;
            int var13;
            if (var5.getOrder() == 1) {
               for(var12 = 1; var12 < var6.size(); ++var12) {
                  var11.c = (Integer)var6.get(var12) - 1;
                  var11.a = (Integer)var6.get(var12 - 1);

                  for(var13 = 1; var13 < var8.size(); ++var13) {
                     var11.d = (Integer)var8.get(var13) - 1;
                     var11.b = (Integer)var8.get(var13 - 1);
                     if (this.k.getDisplayRightToLeft()) {
                        var10 = new com.aspose.cells.b.a.b.zq(-(Float)var9.get(var13), (Float)var7.get(var12 - 1), (Float)var9.get(var13) - (Float)var9.get(var13 - 1), (Float)var7.get(var12) - (Float)var7.get(var12 - 1));
                     } else {
                        var10 = new com.aspose.cells.b.a.b.zq((Float)var9.get(var13 - 1), (Float)var7.get(var12 - 1), (Float)var9.get(var13) - (Float)var9.get(var13 - 1), (Float)var7.get(var12) - (Float)var7.get(var12 - 1));
                     }

                     if (var2 || this.a(var11)) {
                        this.a(var11, var10, var3);
                     }
                  }
               }
            } else {
               for(var12 = 1; var12 < var8.size(); ++var12) {
                  var11.d = (Integer)var8.get(var12) - 1;
                  var11.b = (Integer)var8.get(var12 - 1);
                  if (var11.b <= var11.d) {
                     for(var13 = 1; var13 < var6.size(); ++var13) {
                        var11.c = (Integer)var6.get(var13) - 1;
                        var11.a = (Integer)var6.get(var13 - 1);
                        if (this.k.getDisplayRightToLeft()) {
                           var10 = new com.aspose.cells.b.a.b.zq(-(Float)var9.get(var12), (Float)var7.get(var13 - 1), (Float)var9.get(var12) - (Float)var9.get(var12 - 1), (Float)var7.get(var13) - (Float)var7.get(var13 - 1));
                        } else {
                           var10 = new com.aspose.cells.b.a.b.zq((Float)var9.get(var12 - 1), (Float)var7.get(var13 - 1), (Float)var9.get(var12) - (Float)var9.get(var12 - 1), (Float)var7.get(var13) - (Float)var7.get(var13 - 1));
                        }

                        if (var2 || this.a(var11)) {
                           this.a(var11, var10, var3);
                        }
                     }
                  }
               }
            }

            var12 = this.f.size();

            for(int var14 = var12 - 1; var14 >= 0; --var14) {
               zfu var15 = ((zasn)this.f.get(var14)).c;
               if (var2 || this.a(var15.a, var15.b, var15.c, var15.d)) {
                  break;
               }

               this.f.remove(var14);
            }
         } else {
            this.a(var11, new com.aspose.cells.b.a.b.zq(), var3);
         }

      }
   }

   private void d() throws Exception {
      if (this.k.getPageSetup().getPrintComments() == 2) {
         if (this.k.getComments() != null || this.k.getComments().getCount() != 0) {
            ArrayList var1 = new ArrayList();
            Iterator var2;
            Comment var3;
            if (this.N != null && this.N.size() != 0) {
               var2 = this.k.getComments().iterator();

               label63:
               while(true) {
                  while(true) {
                     if (!var2.hasNext()) {
                        break label63;
                     }

                     var3 = (Comment)var2.next();

                     for(int var4 = 0; var4 < this.N.size(); ++var4) {
                        CellArea var5 = (CellArea)this.N.get(var4);
                        if (var3.getRow() >= var5.StartRow && var3.getRow() <= var5.EndRow && var3.getColumn() >= var5.StartColumn && var3.getColumn() <= var5.EndColumn) {
                           com.aspose.cells.b.a.a.ze.a(var1, (Object)var3);
                           break;
                        }
                     }
                  }
               }
            } else {
               var2 = this.k.getComments().iterator();

               while(var2.hasNext()) {
                  var3 = (Comment)var2.next();
                  com.aspose.cells.b.a.a.ze.a(var1, (Object)var3);
               }
            }

            if (var1.size() > 0) {
               float var15 = 0.0F;
               float var16 = 0.0F;
               com.aspose.cells.a.d.zb var17 = new com.aspose.cells.a.d.zb();
               float var18 = (float)((double)((float)this.k.getCells().getStandardHeightPixels() * 72.0F) * this.p[1]) / (float)this.k.getWorkbook().getWorksheets().L();
               int var6 = (int)(this.t / (double)var18);
               int var7 = 0;
               this.a(var17);

               for(int var8 = 0; var8 < var1.size(); ++var8) {
                  Comment var9 = (Comment)var1.get(var8);
                  zbmg var10 = (zbmg)this.L.h.get(this.l.h().m());
                  float var11 = var10.a;
                  double[] var12 = var10.b;
                  zlx var13 = new zlx(var15, var16, var9, this.k, this.p, (float)this.s, (float)this.t, this.e, var11, var12);
                  com.aspose.cells.a.d.zb var14 = var13.a();
                  if (var6 - var7 >= var13.b()) {
                     var17.a((com.aspose.cells.a.d.zl)var14);
                     var16 += (float)(var13.b() + 1) * var18;
                     var7 += var13.b() + 1;
                  } else {
                     byte var19;
                     if (var6 - var7 >= 1) {
                        var17.a((com.aspose.cells.a.d.zl)var13.a(0));
                        var17 = new com.aspose.cells.a.d.zb();
                        var16 = 0.0F;
                        var19 = 0;
                        this.a(var17);
                        var13.a(new com.aspose.cells.b.a.b.zo(var15, var16));
                        var17.a((com.aspose.cells.a.d.zl)var13.a(1));
                        var16 += (float)(var13.c() + 1) * var18;
                        var7 = var19 + var13.c() + 1;
                     } else {
                        var17 = new com.aspose.cells.a.d.zb();
                        var16 = 0.0F;
                        var19 = 0;
                        this.a(var17);
                        var13.a(new com.aspose.cells.b.a.b.zo(var15, var16));
                        var17.a((com.aspose.cells.a.d.zl)var13.a());
                        var16 += (float)(var13.b() + 1) * var18;
                        var7 = var19 + var13.b() + 1;
                     }
                  }
               }

            }
         }
      }
   }

   private void a(com.aspose.cells.a.d.zb var1) {
      zasn var2 = new zasn();
      var2.b = -1;
      var2.a = this.m;
      var2.h = this.q;
      var2.i = this.r;
      var2.n = this.G;
      var2.p = this.I;
      var2.o = this.H;
      var2.q = this.J;
      var2.r = var1;
      com.aspose.cells.b.a.a.ze.a(this.f, (Object)var2);
   }

   private void a(int var1) throws Exception {
      Worksheet var2 = this.i.getWorksheets().get(var1);
      if (var2.isVisible()) {
         this.m = var1;
         this.M = zatm.a(var2);
         if (var2.getType() == 2) {
            this.c(var2);
         } else {
            this.b(var2);
            if (this.N != null && this.N.size() != 0) {
               boolean var3 = false;

               for(int var4 = 0; var4 < this.N.size(); ++var4) {
                  CellArea var5 = (CellArea)this.N.get(var4);
                  if ((var5.StartRow != 0 || var5.EndRow != 65535) && (var5.StartRow != -1 || var5.EndRow != -1) && (var5.StartRow != 0 || var5.EndRow != 1048575)) {
                     if (var5.StartColumn == -1 && var5.EndColumn == -1) {
                        if (this.e()) {
                           continue;
                        }

                        var5.StartColumn = this.c;
                        var5.EndColumn = this.d;
                     } else {
                        this.a = var5.StartRow;
                        this.b = var5.EndRow;
                        this.c = var5.StartColumn;
                        this.d = var5.EndColumn;
                     }
                  } else {
                     if (this.e()) {
                        continue;
                     }

                     var5.EndRow = this.b;
                     var5.StartRow = this.a;
                     this.c = var5.StartColumn == -1 ? this.c : var5.StartColumn;
                     this.d = var5.EndColumn == -1 ? this.d : var5.EndColumn;
                  }

                  var3 = true;
                  this.a(var5, true, var4);
               }

               if (!var3) {
                  return;
               }
            } else {
               if (this.e()) {
                  return;
               }

               this.a(new CellArea(), false, -1);
            }

            this.d();
         }
      }
   }

   private boolean e() {
      return this.d < 0 || this.c < 0 || this.a < 0 || this.b < 0;
   }

   private void c(Worksheet var1) {
      this.a(var1);
      zasn var2 = new zasn();
      zfu var3 = new zfu();
      this.g();
      var2.a = this.m;
      var2.c = var3;
      var2.d = 0;
      var2.e = 0;
      var2.f = 0;
      var2.g = 0;
      var2.h = this.q;
      var2.i = this.r;
      var2.j = this.s;
      var2.k = this.t;
      var2.l = this.x;
      double[] var4 = new double[]{0.0D, 0.0D};
      this.a(var3.b, var3.d, this.s / 72.0D, var4);
      var2.n = var4[0];
      var2.p = var4[1];
      this.b(var3.a, var3.c, this.t / 72.0D, var4);
      var2.o = var4[0];
      var2.q = var4[1];
      var2.m = new com.aspose.cells.b.a.b.zq(0.0F, 0.0F, (float)this.q * 72.0F, (float)this.r * 72.0F);
      com.aspose.cells.b.a.a.ze.a(this.f, (Object)var2);
   }

   private void a(int var1, int var2, double var3, double[] var5) {
      double var6 = 0.0D;
      double var8 = 0.0D;
      if (this.k.getPageSetup().getCenterHorizontally()) {
         double var10 = 0.0D;
         var3 *= 2.54D;
         boolean var12 = false;

         int var13;
         for(var13 = var1; var13 <= var2; ++var13) {
            if (var13 >= this.B && var13 <= this.C) {
               var12 = true;
            }

            var10 += this.l.c.b(var13) * 72.0D;
         }

         if (!var12 && this.B >= 0 && this.C >= 0) {
            for(var13 = this.B; var13 <= this.C; ++var13) {
               var10 += this.l.c.b(var13) * 72.0D;
            }
         }

         var10 = var10 * this.p[0] / 72.0D * 2.54D;
         if (var3 > var10) {
            double var15 = (var3 - var10) / 2.0D;
            var6 = var15 + this.G;
            var6 = com.aspose.cells.b.a.zq.b(var6, 2);
            var8 = var15 + this.I;
            var8 = com.aspose.cells.b.a.zq.b(var8, 2);
         } else {
            var6 = this.G;
            var8 = this.I;
         }
      } else {
         var6 = this.G;
         var8 = this.I;
      }

      if (var6 < 0.0D) {
         var6 = 0.0D;
      }

      if (var8 < 0.0D) {
         var8 = 0.0D;
      }

      var5[0] = var6;
      var5[1] = var8;
   }

   private void b(int var1, int var2, double var3, double[] var5) {
      double var6 = 0.0D;
      double var8 = 0.0D;
      if (this.k.getPageSetup().getCenterVertically()) {
         double var10 = 0.0D;
         var3 *= 2.54D;
         boolean var12 = false;

         int var13;
         for(var13 = var1; var13 <= var2; ++var13) {
            if (var13 >= this.z && var13 <= this.A) {
               var12 = true;
            }

            var10 += this.k.getCells().getRowHeightInch(var13);
         }

         if (!var12 && this.z >= 0 && this.A >= 0) {
            for(var13 = this.z; var13 <= this.A; ++var13) {
               var10 += this.k.getCells().getRowHeightInch(var13);
            }
         }

         var10 = var10 * this.p[1] * 2.54D;
         if (var3 > var10) {
            double var15 = (var3 - var10) / 2.0D;
            var6 = var15 + this.H;
            var6 = com.aspose.cells.b.a.zq.b(var6, 2);
            var8 = var15 + this.J;
            var8 = com.aspose.cells.b.a.zq.b(var8, 2);
         } else {
            var6 = this.H;
            var8 = this.J;
         }
      } else {
         var6 = this.H;
         var8 = this.J;
      }

      if (var6 < 0.0D) {
         var6 = 0.0D;
      }

      if (var8 < 0.0D) {
         var8 = 0.0D;
      }

      var5[0] = var6;
      var5[1] = var8;
   }

   private void a(zfu var1, com.aspose.cells.b.a.b.zq var2, int var3) {
      zasn var4 = new zasn();
      var4.b = var3;
      var4.a = this.m;
      var4.c = new zfu(var1.a, var1.b, var1.c, var1.d);
      var4.d = this.a;
      var4.e = this.b;
      var4.f = this.c;
      var4.g = this.d;
      double[] var5 = new double[]{0.0D, 0.0D};
      if (!this.h.getOnlyArea()) {
         this.a(var1.b, var1.d, this.s / 72.0D, var5);
         var4.n = var5[0];
         var4.p = var5[1];
         this.b(var1.a, var1.c, this.t / 72.0D, var5);
         var4.o = var5[0];
         var4.q = var5[1];
      }

      double var6;
      int var8;
      if (this.h != null && this.h.getOnePagePerSheet()) {
         var4.j = (double)var2.h();
         if (this.B != -1 && this.B < var1.b) {
            var6 = 0.0D;

            for(var8 = this.B; var8 <= this.C; ++var8) {
               var6 += this.l.getColumnWidthInch(var8) * 72.0D;
            }

            var6 *= this.p[0];
            var4.j += var6;
         }

         var4.k = (double)var2.i();
         if (this.z != -1 && this.z < var1.a) {
            var6 = 0.0D;

            for(var8 = this.z; var8 <= this.A; ++var8) {
               var6 += this.l.getRowHeightInch(var8) * 72.0D;
            }

            var6 *= this.p[1];
            var4.k += var6;
         }

         var4.h = var4.j / 72.0D + (var4.n + var4.p) / 2.5399999618530273D;
         var4.i = var4.k / 72.0D + (var4.o + var4.q) / 2.5399999618530273D;
      } else if (this.h != null && this.h.getAllColumnsInOnePagePerSheet()) {
         var4.j = (double)var2.h();
         if (this.B != -1 && this.B < var1.b) {
            var6 = 0.0D;

            for(var8 = this.B; var8 <= this.C; ++var8) {
               var6 += this.l.getColumnWidthInch(var8) * 72.0D;
            }

            var6 *= this.p[0];
            var4.j += var6;
         }

         var4.k = (double)var2.i();
         var4.h = var4.j / 72.0D + (var4.n + var4.p) / 2.5399999618530273D;
         var4.i = this.r;
      } else if (this.h != null && this.h.getOnlyArea()) {
         var4.j = (double)var2.h();
         if (this.B != -1 && this.B < var1.b) {
            var6 = 0.0D;

            for(var8 = this.B; var8 <= this.C; ++var8) {
               var6 += this.l.getColumnWidthInch(var8) * 72.0D;
            }

            var6 *= this.p[0];
            var4.j += var6;
         }

         var4.k = (double)var2.i();
         if (this.z != -1 && this.z < var1.a) {
            var6 = 0.0D;

            for(var8 = this.z; var8 <= this.A; ++var8) {
               var6 += this.l.getRowHeightInch(var8) * 72.0D;
            }

            var6 *= this.p[1];
            var4.k += var6;
         }

         var4.h = var4.j / 72.0D;
         var4.i = var4.k / 72.0D;
      } else {
         var4.h = this.q;
         var4.i = this.r;
         var4.j = this.s;
         var4.k = this.t;
      }

      var4.l = this.b(var1);
      var4.m = var2;
      com.aspose.cells.b.a.a.ze.a(this.f, (Object)var4);
      this.i.l();
   }

   private void f() {
      if (this.x != null) {
         Iterator var1 = this.x.iterator();

         while(true) {
            zfu var2;
            do {
               if (!var1.hasNext()) {
                  return;
               }

               var2 = (zfu)var1.next();
            } while((var2.a > this.A || var2.c < this.z) && (var2.b > this.C || var2.d < this.B));

            com.aspose.cells.b.a.a.ze.a(this.y, (Object)var2);
         }
      }
   }

   private ArrayList b(zfu var1) {
      ArrayList var2 = new ArrayList();
      Iterator var3 = this.y.iterator();

      zfu var4;
      while(var3.hasNext()) {
         var4 = (zfu)var3.next();
         com.aspose.cells.b.a.a.ze.a(var2, (Object)var4);
      }

      if (this.x != null) {
         var3 = this.x.iterator();

         while(var3.hasNext()) {
            var4 = (zfu)var3.next();
            if (var4.a <= var1.c && var4.b <= var1.d && var4.c >= var1.a && var4.d >= var1.b) {
               com.aspose.cells.b.a.a.ze.a(var2, (Object)var4);
            }
         }
      }

      return var2;
   }

   private boolean a(int var1, int var2, int var3) {
      return var2 <= var1 && var3 >= var1;
   }

   private ArrayList a(int var1, int var2, PageSetup var3, double var4) {
      ArrayList var6 = new ArrayList();
      double var7 = 0.0D;
      if (this.z != -1) {
         for(int var9 = this.z; var9 <= this.A; ++var9) {
            var7 += this.l.getRowHeightInch(var9) * 72.0D;
         }

         var7 *= this.p[1];
      }

      double var14 = 0.0D;
      double var11 = this.t - var7;

      for(int var13 = var1; var13 < var2; ++var13) {
         if (!this.a(var13, this.z, this.A)) {
            var14 += this.l.getRowHeightInch(var13) * 72.0D * this.p[1];
            if (var14 >= var11) {
               com.aspose.cells.b.a.a.ze.a(var6, (Object)var13);
               var14 = this.l.getRowHeightInch(var13) * 72.0D * this.p[1];
            }
         }
      }

      return var6;
   }

   private void a(double var1, ArrayList var3, com.aspose.cells.b.a.b.zp var4) {
      PageSetup var5 = this.k.getPageSetup();
      com.aspose.cells.b.a.a.ze.a(var3, (Object)var4.d());
      com.aspose.cells.b.a.a.ze.a(var3, (Object)(var4.d() + var4.f()));
      double var6 = 0.0D;
      if (this.h == null || !this.h.getOnePagePerSheet()) {
         if (this.z != -1) {
            var6 = this.l.getRows().b.b(this.z, this.A);
            var6 *= this.p[1];
         }

         ArrayList var8;
         int var12;
         if (var5.isPercentScale() || var5.getFitToPagesTall() == 0) {
            if (this.k.b != null) {
               Iterator var20 = this.k.b.iterator();

               label130:
               while(true) {
                  ArrayList var25;
                  do {
                     do {
                        if (!var20.hasNext()) {
                           break label130;
                        }

                        PivotTable var22 = (PivotTable)var20.next();
                        var25 = var22.getHorizontalBreaks();
                     } while(var25 == null);
                  } while(var25.size() <= 0);

                  Iterator var11 = var25.iterator();

                  while(var11.hasNext()) {
                     var12 = (Integer)var11.next();
                     if (!var3.contains(var12)) {
                        com.aspose.cells.b.a.a.ze.a(var3, (Object)var12);
                     }
                  }
               }
            }

            for(int var21 = 0; var21 < this.k.getHorizontalPageBreaks().getCount(); ++var21) {
               HorizontalPageBreak var23 = this.k.getHorizontalPageBreaks().get(var21);
               com.aspose.cells.b.a.b.zp var27 = new com.aspose.cells.b.a.b.zp(var23.getStartColumn(), var23.getRow(), var23.getEndColumn() - var23.getStartColumn(), 0);
               if (var4.a(var27) && !var3.contains(var23.getRow())) {
                  com.aspose.cells.b.a.a.ze.a(var3, (Object)var23.getRow());
               }
            }

            Collections.sort(var3);
            var8 = new ArrayList();

            int var29;
            for(int var24 = 0; var24 < var3.size() - 1; ++var24) {
               var29 = (Integer)var3.get(var24);
               int var28 = (Integer)var3.get(var24 + 1);
               com.aspose.cells.b.a.a.ze.a(var8, (Collection)this.a(var29, var28, var5, var1));
            }

            Iterator var26 = var8.iterator();

            while(var26.hasNext()) {
               var29 = (Integer)var26.next();
               if (!var3.contains(var29)) {
                  com.aspose.cells.b.a.a.ze.a(var3, (Object)var29);
               }
            }

            Collections.sort(var3);
            return;
         }

         if (!var5.isPercentScale() && var5.getFitToPagesTall() != 0) {
            double[] var9 = (double[])com.aspose.cells.b.a.za.b(this.p);
            double var10 = Math.min(this.p[0] / this.M[0], this.p[1] / this.M[1]);
            var12 = var5.getFitToPagesTall();

            while(true) {
               while(true) {
                  var8 = (ArrayList)var3.clone();
                  double var13 = 0.0D;

                  for(int var17 = var4.d(); var17 < var4.d() + var4.f(); ++var17) {
                     double var15 = this.l.getRows().b.b(var17);
                     var13 += var15;
                     double var18 = var1;
                     if (this.z >= 0 && !this.a(this.z, this.a(var8, var17), var17)) {
                        var18 = var1 - var6;
                     }

                     if (var13 * var9[1] - 0.0010000000474974513D > var18) {
                        if (!var3.contains(var17)) {
                           com.aspose.cells.b.a.a.ze.a(var8, (Object)var17);
                        }

                        var13 = var15;
                     }
                  }

                  if (var8.size() - 1 <= var12) {
                     if (var9[0] >= 0.1D && var9[1] >= 0.1D || this.h != null && (this.h.getOnePagePerSheet() || this.h.getAllColumnsInOnePagePerSheet())) {
                        this.p = var9;
                        var3.clear();
                        com.aspose.cells.b.a.a.ze.a(var3, (Collection)var8);
                        Collections.sort(var3);
                        return;
                     }

                     var9 = (double[])com.aspose.cells.b.a.za.b(this.p);
                     ++var12;
                  } else {
                     var10 *= 0.98D;
                     var10 = (double)((int)(var10 * 100.0D)) / 100.0D;
                     var9[0] = this.M[0] * var10;
                     var9[1] = this.M[1] * var10;
                  }
               }
            }
         }
      }

   }

   private int a(ArrayList var1, int var2) {
      return var1.size() == 2 ? (Integer)var1.get(0) : (Integer)var1.get(var1.size() - 1);
   }

   private void a(ArrayList var1, ArrayList var2) {
      PageSetup var3 = this.k.getPageSetup();
      float var4 = 0.0F;
      int var5 = (Integer)var1.get(0);

      int var6;
      for(var6 = 0; var6 < (Integer)var1.get(0); ++var6) {
         var4 += (float)this.k.getCells().getRowHeightInch(var6) * (float)this.p[1] * 72.0F;
      }

      com.aspose.cells.b.a.a.ze.a(var2, (Object)var4);

      for(var6 = 1; var6 < var1.size(); ++var6) {
         for(int var7 = (Integer)var1.get(var6); var5 < var7; ++var5) {
            var4 += (float)this.k.getCells().getRowHeightInch(var5) * (float)this.p[1] * 72.0F;
         }

         com.aspose.cells.b.a.a.ze.a(var2, (Object)var4);
      }

   }

   private void b(double var1, ArrayList var3, com.aspose.cells.b.a.b.zp var4) {
      com.aspose.cells.b.a.a.ze.a(var3, (Object)var4.c());
      com.aspose.cells.b.a.a.ze.a(var3, (Object)(var4.c() + var4.e()));
      PageSetup var5 = this.k.getPageSetup();
      Cells var6 = this.k.getCells();
      double var7 = 0.0D;
      double var9 = 0.0D;
      if (this.h == null || !this.h.getOnePagePerSheet() && !this.h.getAllColumnsInOnePagePerSheet()) {
         int var11;
         if (this.B != -1) {
            for(var11 = this.B; var11 <= this.C; ++var11) {
               var9 += var6.c.b(var11) * 72.0D;
            }

            var9 *= this.p[0];
         }

         if (var5.isPercentScale() || var5.getFitToPagesWide() == 0) {
            var11 = var4.c();

            for(int var12 = 0; var11 < var4.c() + var4.e() && var11 <= this.d; ++var11) {
               if (var12 < this.k.getVerticalPageBreaks().getCount() && this.k.getVerticalPageBreaks().get(var12).getColumn() == var11) {
                  com.aspose.cells.b.a.a.ze.a(var3, (Object)var11);
                  var7 = var9;
                  ++var12;
               } else {
                  double var13 = var6.c.b(var11) * 72.0D * this.p[0];
                  var7 += var13;
                  if (var7 - 0.009999999776482582D > var1 && var11 > 0) {
                     if (var11 < var4.c() + var4.e()) {
                        com.aspose.cells.b.a.a.ze.a(var3, (Object)var11);
                     }

                     var7 = var13;
                     if (this.B != -1 && this.B < var11) {
                        var7 = var13 + var9;
                     }
                  }
               }
            }
         }

         var11 = var5.getFitToPagesWide();
         if (!var5.isPercentScale() && var11 != 0) {
            double[] var23 = (double[])com.aspose.cells.b.a.za.b(this.p);
            double var14 = Math.min(this.p[0] / this.M[0], this.p[1] / this.M[1]);

            while(true) {
               while(true) {
                  ArrayList var22 = (ArrayList)var3.clone();
                  double var16 = 0.0D;

                  for(int var18 = var4.c(); var18 < var4.c() + var4.e(); ++var18) {
                     var16 += var6.c.b(var18) * 72.0D;
                     double var19 = var1;
                     if (this.B >= 0 && !this.a(this.B, this.a(var22, var18), var18)) {
                        if (var1 < var9) {
                           var16 = 0.0D;

                           int var21;
                           for(var21 = this.B; var21 <= this.C; ++var21) {
                              var16 += var6.c.b(var21) * 72.0D;
                           }

                           for(var21 = var4.c(); var21 < var4.c() + var4.e(); ++var21) {
                              var16 += var6.c.b(var21) * 72.0D;
                           }

                           this.p[0] = var1 / var16;
                           this.p[1] = this.p[0];
                           return;
                        }

                        var19 = var1 - var9;
                     }

                     if (var16 * var23[0] > var19) {
                        if (!var22.contains(var18)) {
                           com.aspose.cells.b.a.a.ze.a(var22, (Object)var18);
                        }

                        var16 = var6.c.b(var18) * 72.0D;
                     }
                  }

                  if (var22.size() - 1 <= var11) {
                     if (var23[0] >= 0.1D || this.h != null && (this.h.getOnePagePerSheet() || this.h.getAllColumnsInOnePagePerSheet())) {
                        this.p = var23;
                        var3.clear();
                        com.aspose.cells.b.a.a.ze.a(var3, (Collection)var22);
                        Collections.sort(var3);
                        return;
                     }

                     var23 = (double[])com.aspose.cells.b.a.za.b(this.p);
                     ++var11;
                  } else {
                     var14 *= 0.95D;
                     var14 = (double)((int)(var14 * 100.0D)) / 100.0D;
                     var23[0] = this.M[0] * var14;
                     var23[1] = this.M[1] * var14;
                  }
               }
            }
         }
      }

      Collections.sort(var3);
   }

   private void b(ArrayList var1, ArrayList var2) {
      PageSetup var3 = this.k.getPageSetup();
      float var4 = 0.0F;

      int var5;
      for(var5 = 0; var5 < (Integer)var1.get(0); ++var5) {
         var4 += (float)this.l.c.b(var5) * (float)this.p[0] * 72.0F;
      }

      com.aspose.cells.b.a.a.ze.a(var2, (Object)var4);
      var5 = (Integer)var1.get(0);

      for(int var6 = 1; var6 < var1.size(); ++var6) {
         for(int var7 = (Integer)var1.get(var6); var5 < var7; ++var5) {
            var4 += (float)this.l.c.b(var5) * (float)this.p[0] * 72.0F;
         }

         com.aspose.cells.b.a.a.ze.a(var2, (Object)var4);
      }

   }

   private void a(PageSetup var1) {
      double[] var2 = new double[]{this.q};
      double[] var3 = new double[]{this.r};
      zatm.a(var1, var2, var3);
      this.q = var2[0];
      this.r = var3[0];
      double[] var4 = new double[]{this.s};
      double[] var5 = new double[]{this.t};
      zatm.a(this.k, var4, var5, this.q, this.r);
      this.s = var4[0];
      this.t = var5[0];
      this.u = var1.getHeaderMargin();
      this.v = var1.getFooterMargin();
      this.G = var1.getLeftMargin();
      this.I = var1.getRightMargin();
      this.H = var1.getTopMargin();
      this.J = var1.getBottomMargin();
   }

   private void g() {
      zbmg var1 = new zbmg();
      var1.a = 1.0F;
      var1.b = new double[]{1.0D, 1.0D};
      var1.c = new double[]{1.0D, 1.0D};
      var1.d = this.u;
      var1.e = this.v;
      var1.f = this.z;
      var1.g = this.A;
      var1.h = this.B;
      var1.i = this.C;
      var1.j = (ArrayList)this.K.get(this.k);
      this.L.h.put(this.m, var1);
   }

   private void h() {
      PageSetup var1 = this.k.getPageSetup();
      float var2 = 1.0F;
      if (!this.h.getOnlyArea()) {
         if (!var1.isPercentScale() && (var1.getFitToPagesTall() != 0 || var1.getFitToPagesWide() != 0)) {
            var2 = (float)Math.min(this.p[0] / this.M[0], this.p[1] / this.M[1]);
         } else {
            var2 = (float)var1.getZoom() / 100.0F;
         }
      }

      zbmg var3;
      if (this.L.h.containsKey(this.m)) {
         var3 = (zbmg)((zbmg)this.L.h.get(this.m));
         if (var2 < var3.a) {
            var3.a = var2;
            var3.c = new double[]{this.p[0], this.p[1]};
         }
      } else {
         var3 = new zbmg();
         var3.a = var2;
         var3.b = new double[]{this.M[0], this.M[1]};
         var3.c = new double[]{this.p[0], this.p[1]};
         var3.d = this.u;
         var3.e = this.v;
         var3.f = this.z;
         var3.g = this.A;
         var3.h = this.B;
         var3.i = this.C;
         var3.j = (ArrayList)this.K.get(this.k);
         this.L.h.put(this.m, var3);
      }

   }
}
